<?php
	@header("Content-Type:text/html;charset=utf-8");
	@header("Access-Control-Allow-Origin:*");
	
	
	$conn =  mysql_connect("localhost","root","root");   
	$a = mysql_select_db("object",$conn);   //连接数据库
	
	$id = uniqid();
	$user= $_GET["user"];
	$email= $_GET["email"];
	$phone= $_GET["phone"];
	$pwd= $_GET["pwd"];


	$sql = "insert into userinfo(user_id,user_name,user_email,user_phone,user_pwd) values('$id','$user','$email','$phone','$pwd')";
//	echo $sql;
	mysql_query("set charset set utf-8");     //数据库输入输出编码格式
	
	$result = mysql_query($sql); 
	
	$row = mysql_affected_rows();
//	echo $row;
	$msg = array();
	if($row&&$row==1){
		$msg["status"] = true;
		$msg["msg"] = "注册成功";
	}else{
		$msg["status"] = false;
		$msg["msg"] = "注册失败";
	}
	echo json_encode($msg);
?>